<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>基础设置</title>
    <link rel="stylesheet" href="../../plugins/element-ui/index.css">
    <style>
        span {
            font-size: 10px;
        }
    </style>

</head>
<body>
<div id="app">
    <el-tabs type="border-card">
        <!--年级设置-->
      <!--  <el-tab-pane label="年级设置">
            <span>状态：</span>
            <template>
                <el-select v-model="classFrom.value" size="mini" style="width:10%" filterable placeholder="请选择">
                    <el-option v-for="item in options" :key="item.value" size="mini" :label="item.label"
                               :value="item.value"></el-option>
                </el-select>
            </template>

            <el-button type="primary" size="mini">查询</el-button>
            <el-button size="mini" @click="classFrom.value=''">重置</el-button>
            &lt;!&ndash;            <el-button type="primary" size="mini">添加年级</el-button>&ndash;&gt;
            <span style="margin-left:68.4%">
                <el-button @click="drawer = true" size="mini" type="primary" style="margin-left: 16px;">添加年级</el-button>
            </span>

            <el-table
                    :data="tableData"
                    style="width: 100%">
                <el-table-column
                        label="排序"
                        prop="serialNumber">
                </el-table-column>
                <el-table-column
                        label="入学年份"
                        prop="startYear">
                </el-table-column>
                <el-table-column
                        label="年级名称"
                        prop="semesterName">
                </el-table-column>
                <el-table-column
                        label="备注"
                        prop="studentID">
                </el-table-column>
                <el-table-column
                        label="状态"
                        prop="name">
                </el-table-column>
                <el-table-column
                        label="添加时间"
                        prop="sex">
                </el-table-column>
                <el-table-column
                        label="操作"
                        align="center">
                    <div>
                        <el-link type="primary">设置毕业</el-link>
                        <el-link type="primary">编辑</el-link>
                        <el-link type="danger">删除</el-link>
                    </div>

                </el-table-column>
            </el-table>

            &lt;!&ndash;分页&ndash;&gt;
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage4"
                        :page-sizes="[10, 20, 30, 40]"
                        :page-size="10"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="0">
                </el-pagination>
            </div>
            <el-drawer
                    title="添加年级"
                    :direction="direction"
                    :before-close="handleClose"
                    :visible.sync="drawer">
                <el-form ref="form" :model="form" label-width="80px">

                    <el-form-item label="入学年份">
                        <el-select v-model="form.region" placeholder="请选择">
                            <el-option label="区域一" value="shanghai"></el-option>
                            <el-option label="区域二" value="beijing"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="年级名称">
                        <el-input v-model="form.name"></el-input>
                    </el-form-item>
                    <el-form-item label="排序">
                        <el-input v-model="form.name"></el-input>
                    </el-form-item>

                    <el-form-item label="启用状态">
                        &lt;!&ndash;                        <span style="margin-left: 20px;font-size: 15px"> 启用状态</span>&ndash;&gt;
                        <el-radio v-model="radio" label="1">启用</el-radio>
                        <el-radio v-model="radio" label="2">禁用</el-radio>
                    </el-form-item>


                    <el-form-item label="备注：">
                        <el-input type="textarea" v-model="form.desc"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="">立即创建</el-button>
                        <el-button @click="">取消</el-button>
                    </el-form-item>
                </el-form>
            </el-drawer>
        </el-tab-pane>-->

        <!--学期设置-->
        <!--  <el-tab-pane label="学期设置">
            <span>学期状态：</span>
            <template>
                <el-select v-model="semesterFrom.value" size="mini" style="width:10%" filterable placeholder="请选择">
                    <el-option v-for="item in options" :key="item.value" size="mini" :label="item.label"
                               :value="item.value"></el-option>
                </el-select>
            </template>

            <el-button type="primary" size="mini">查询</el-button>
            <el-button size="mini" @click="semesterFrom.value=''">重置</el-button>
            <span style="margin-left:68%">
                  <el-button type="primary" @click="drawer2= true" size="mini">添加学期</el-button>
            </span>

            <el-table
                    :data="tableData"
                    style="width: auto">
                <el-table-column
                        label="序号"
                        prop="serialNumber">
                </el-table-column>
                <el-table-column
                        label="学期名称"
                        prop="semesterName">
                </el-table-column>
                <el-table-column
                        label="学期时间"
                        prop="studentID">
                </el-table-column>
                <el-table-column
                        label="备注"
                        prop="name">
                </el-table-column>
                <el-table-column
                        label="学期状态"
                        prop="sex">
                </el-table-column>
                <el-table-column
                        label="添加时间"
                        prop="status">
                </el-table-column>
                <el-table-column
                        label="操作"
                        align="center">
                    <div>
                        <el-link type="primary">编辑</el-link>
                        <el-link type="danger">删除</el-link>
                    </div>
                </el-table-column>
            </el-table>
            &lt;!&ndash;分页&ndash;&gt;
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage4"
                        :page-sizes="[10, 20, 30, 40]"
                        :page-size="10"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="0">
                </el-pagination>
            </div>
            <el-drawer
                    title="添加学期"
                    :direction="direction"
                    :before-close="handleClose"
                    :visible.sync="drawer2">
                <el-form ref="form" :model="form" label-width="80px">

                    <el-form-item label="学期名称">
                        <el-input v-model="form.name"></el-input>
                    </el-form-item>
                    <el-form-item label="学期时间">
                        <div class="block">
                            <el-date-picker
                                    v-model="value1"
                                    type="datetimerange"
                                    start-placeholder="选择学期开始日期"
                                    end-placeholder="选择学期结束日期"
                                    :default-time="['12:00:00']">
                            </el-date-picker>
                        </div>
                    </el-form-item>

                    <el-form-item label="学期状态">
                        &lt;!&ndash;                        <span style="margin-left: 20px;font-size: 15px"> 启用状态</span>&ndash;&gt;
                        <el-radio v-model="radio" label="1">启用</el-radio>
                        <el-radio v-model="radio" label="2">禁用</el-radio>
                    </el-form-item>


                    <el-form-item label="备注：">
                        <el-input type="textarea" v-model="form.desc"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="">确定</el-button>
                        <el-button @click="dialogFormVisible = false">取消</el-button>
                    </el-form-item>
                </el-form>
            </el-drawer>
        </el-tab-pane>-->
        <!--上课时间设置-->
        <!--<el-tab-pane label="上课时间设置">
            <span>状态：</span>
            <template>
                <el-select v-model="courseFrom.value" size="mini" style="width:10%" filterable placeholder="请选择">
                    <el-option v-for="item in options" :key="item.value" size="mini" :label="item.label"
                               :value="item.value"></el-option>
                </el-select>
            </template>

            <el-button type="primary" size="mini">查询</el-button>
            <el-button size="mini" @click="courseFrom.value=''">重置</el-button>
            <span style="margin-left:68%">
                  <el-button type="primary" @click="drawer3= true" size="mini">添加上课时间</el-button>
            </span>
            <el-table
                    :data="tableData"
                    style="width: 100%">
                <el-table-column
                        label="排序"
                        prop="serialNumber">
                </el-table-column>
                <el-table-column
                        label="上课时间名称"
                        prop="startYear">
                </el-table-column>
                <el-table-column
                        label="上课时间"
                        prop="semesterName">
                </el-table-column>
                <el-table-column
                        label="备注"
                        prop="studentID">
                </el-table-column>
                <el-table-column
                        label="状态"
                        prop="name">
                </el-table-column>
                <el-table-column
                        label="添加时间"
                        prop="sex">
                </el-table-column>
                <el-table-column
                        label="操作"
                        align="center">
                    <div>
                        <el-link type="primary">编辑</el-link>
                        <el-link type="danger">删除</el-link>
                    </div>

                </el-table-column>
            </el-table>
            &lt;!&ndash;分页&ndash;&gt;
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage4"
                        :page-sizes="[10, 20, 30, 40]"
                        :page-size="10"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="0">
                </el-pagination>
            </div>
            <el-drawer
                    title="添加上课时间"
                    :direction="direction"
                    :before-close="handleClose"
                    :visible.sync="drawer3">
                <el-form ref="form" :model="form" label-width="80px">

                    <el-form-item label="上课时间名称">
                        <el-input v-model="form.name"></el-input>
                    </el-form-item>
                    <el-form-item label="上课时间">
                        <div class="block">
                            <el-date-picker
                                    v-model="value1"
                                    type="datetimerange"
                                    start-placeholder="选择学期开始日期"
                                    end-placeholder="选择学期结束日期"
                                    :default-time="['12:00:00']">
                            </el-date-picker>
                        </div>
                    </el-form-item>
                    <el-form-item label="排序">
                        <el-input v-model="form.name"></el-input>
                    </el-form-item>

                    <el-form-item label="启用状态">
                        &lt;!&ndash;                        <span style="margin-left: 20px;font-size: 15px"> 启用状态</span>&ndash;&gt;
                        <el-radio v-model="radio" label="1">启用</el-radio>
                        <el-radio v-model="radio" label="2">禁用</el-radio>
                    </el-form-item>


                    <el-form-item label="备注：">
                        <el-input type="textarea" v-model="form.desc"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="">确定</el-button>
                        <el-button @click="dialogFormVisible = false">取消</el-button>
                    </el-form-item>
                </el-form>
            </el-drawer>
        </el-tab-pane>-->
        <!--学校设置-->
        <el-tab-pane label="学校设置">
            <span slot="label" @click="StSchoolList()">学校设置</span>
            <span>状态：</span>
            <!--
              StSchoolOptions:[
                   {value: '0', label: '未认证'},
                   {value: '1', label: '已认证'}
                ],

            -->
            <template>
                <el-select v-model="StSchoolCondition.state" size="mini" style="width:10%" filterable placeholder="请选择">
                    <el-option v-for="item in StSchoolOptions" :key="item.value" size="mini" :label="item.label"
                               :value="item.value"></el-option>
                </el-select>
            </template>

            <el-button type="primary" size="mini" @click="StSchoolList()">查询</el-button>
            <el-button size="mini" @click="StSchoolReset()">重置</el-button>
            <span style="margin-left:68%">
                 <el-button @click="StSchoolButtonAdd()" type="primary" size="mini"
                            style="margin-left: 16px;">添加学校</el-button>
            </span>
            <el-drawer
                    title="添加学校"
                    :direction="direction"
                    :visible.sync="StSchoolDialog">
                <!--
                 StSchoolCondition:{
                    state:'',
                    sort:'',
                    schoolName: '',
                    remarks: ''
                },
                -->
                <el-form ref="form" :model="StSchoolCondition" label-width="80px">

                    <el-form-item label="学校名称">
                        <el-input v-model="StSchoolCondition.schoolName"></el-input>
                    </el-form-item>
                    <div v-if="StSchoolCondition.areaId != null && StSchoolCondition.areaId != ''">
                    <el-form-item label="所在地区">
                        <!--<el-input v-model="pStDeptDtoAdd.schoolName"></el-input>-->
                        <el-select v-model="StSchoolCondition.areaId" size="mini" style="width:100%" filterable placeholder="请选择">
                            <el-option v-for="item in areaList" :key="item.value" size="mini" :label="item.label"
                                       :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                    </div>
                    <el-form-item label="排序">
                        <el-input v-model="StSchoolCondition.sort"></el-input>
                    </el-form-item>

                    <el-form-item label="学校状态">
                        <!--                        <span style="margin-left: 20px;font-size: 15px"> 启用状态</span>-->
                        <el-radio v-model="StSchoolCondition.state" label=1>启用</el-radio>
                        <el-radio v-model="StSchoolCondition.state" label=0>禁用</el-radio>
                    </el-form-item>


                    <el-form-item label="备注：">
                        <el-input type="textarea" v-model="StSchoolCondition.remarks"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="StSchoolAdd()">确定</el-button>
                        <el-button @click="StDeptDtoCancelAdd()">取消</el-button>
                    </el-form-item>
                </el-form>
            </el-drawer>
            <!--

             StSchoolDataList:[
                    {
                        sort:'',
                        qxName: '',
                        schoolName: '',

                        remarks: '',
                        state: '',
                        createTime: ''
                    }
                ],
            -->
            <el-table
                    :data="StSchoolDataList"
                    style="width: 100%">
                <el-table-column
                        label="排序"
                        prop="sort">
                </el-table-column>
                <el-table-column
                        label="所在地区"
                        prop="qxname">
                </el-table-column>
                <el-table-column
                        label="学校名称"
                        prop="schoolName">
                </el-table-column>
                <el-table-column
                        label="学生认证数量"
                        prop="studentNum">
                </el-table-column>
                <el-table-column
                        label="备注"
                        prop="remarks">
                </el-table-column>
                <el-table-column
                        label="状态"
                        prop="state">
                </el-table-column>
                <el-table-column
                        label="添加时间"
                        prop="createTime">
                </el-table-column>
                <el-table-column
                        label="操作"
                        align="center">

                        <template slot-scope="scope">
                            <div>
                                <el-link type="primary"  @click="updateStSchool(scope.row.scid)">编辑</el-link>
                                <el-link type="danger" @click="deleteStSchool(scope.row.scid)">删除</el-link>
                            </div>
                        </template>
                </el-table-column>
            </el-table>
            <!--分页-->
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChangeStSchool"
                        @current-change="handleCurrentChangeStSchool"
                        :current-page="StSchoolDetails.currentPage"
                        :page-sizes="[10, 20, 30, 40]"
                        :page-size="StSchoolDetails.pageCount"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="StSchoolDetails.totalCount">
                </el-pagination>
            </div>

        </el-tab-pane>
       <!-- 学校院系设置-->
        <el-tab-pane label="学校院系设置">
            <span slot="label" @click="StDeptDtoList()">学校院系设置</span>
              <span style="margin-left:92%">
                 <el-button type="primary" size="mini" @click="StDeptDtoAdd()">添加院系</el-button>
            </span>

            <el-drawer
                    title="添加院系"
                    :before-close="StDeptDtoCancelAdd"
                    :visible.sync="pStDeptDtoDialog"
                    direction="rtl"
                    custom-class="demo-drawer"
                    ref="drawer"
            >

                <!--
                  pStDeptDtoAdd: {
                    //学校名称
                    schoolName: '' ,
                    //院系名称
                    deptName:'',
                    //排序
                    sort:'',
                    // 状态
                    state: '',
                    //备注
                    remarks:''
                },
                -->
                <div class="demo-drawer__content">
                    <el-form ref="form" :model="pStDeptDtoAdd" label-width="80px">
                        <el-form-item label="学校名称">
                            <!--<el-input v-model="pStDeptDtoAdd.schoolName"></el-input>-->
                            <el-select v-model="pStDeptDtoAdd.schoolId" size="mini" style="width:100%" filterable placeholder="请选择">
                                <el-option v-for="item in schoolDownList" :key="item.value" size="mini" :label="item.label"
                                           :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="院系名称">
                            <el-input v-model="pStDeptDtoAdd.deptName"></el-input>
                        </el-form-item>
                        <el-form-item label="排序">
                            <el-input v-model="pStDeptDtoAdd.sort"></el-input>
                        </el-form-item>

                        <el-form-item label="启用状态">
                            <!--                        <span style="margin-left: 20px;font-size: 15px"> 启用状态</span>-->
                            <el-radio v-model="pStDeptDtoAdd.state" label=1>启用</el-radio>
                            <el-radio v-model="pStDeptDtoAdd.state" label=0>禁用</el-radio>
                        </el-form-item>


                        <el-form-item label="备注：">
                            <el-input type="textarea" v-model="pStDeptDtoAdd.remarks"></el-input>
                        </el-form-item>
                    </el-form>
                    <div class="demo-drawer__footer" style="text-align: center;margin-top: 10px">
                        <el-button type="primary" @click="StDeptDtoCancel()">确 定</el-button>
                        <el-button @click="StDeptDtoCancelAdd()">取 消</el-button>
                    </div>
                </div>

            </el-drawer>
            <el-table
                    :data="StDeptDtoDataList"
                    style="width: 100%">
                <el-table-column
                        label="排序"
                        prop="sort">
                </el-table-column>
                <el-table-column
                        label="学校名称"
                        prop="schoolName">
                </el-table-column>
                <el-table-column
                        label="院系名称"
                        prop="deptName">
                </el-table-column>
                <el-table-column
                        label="备注"
                        prop="remarks">
                </el-table-column>
                <el-table-column
                        label="状态"
                        prop="state">
                </el-table-column>
                <el-table-column
                        label="添加时间"
                        prop="createTime">
                </el-table-column>
                <el-table-column
                        label="操作"
                        align="center">
                    <template slot-scope="scope">
                        <div>
                            <el-link type="primary"  @click="updatePStDeptDto(scope.row.did)">编辑</el-link>
                            <el-link type="danger" @click="deletePStDeptDto(scope.row.did)">删除</el-link>
                        </div>
                    </template>
                </el-table-column>
            </el-table>
            <!--分页-->
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChangepStDeptDto"
                        @current-change="handleCurrentChangepStDeptDto"
                        :current-page="pStDeptDtoDetails.currentPage"
                        :page-sizes="[10, 20, 30, 40]"
                        :page-size="pStDeptDtoDetails.pageCount"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="pStDeptDtoDetails.totalCount">
                </el-pagination>
            </div>

        </el-tab-pane>
        <!--院系机构设置-->
        <!-- <el-tab-pane label="院系机构设置">
            <span style="margin-left:92%">
                 <el-button type="primary" size="mini" @click="dialog = true">统计设置</el-button>
            </span>

            <el-drawer
                    title="添加院系机构"
                    :before-close="handleClose"
                    :visible.sync="dialog"
                    direction="rtl"
                    custom-class="demo-drawer"
                    ref="drawer"
            >
                <div class="demo-drawer__content">
                    <el-form ref="form" :model="form" label-width="80px">
                        <el-form-item label="学校名称">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                        <el-form-item label="院系机构">
                            <el-input v-model="form.name" placeholder="请填写学校院系机构名称"></el-input>
                        </el-form-item>
                        <el-form-item label="排序">
                            <el-input v-model="form.name" placeholder="请填写显示排序"></el-input>
                        </el-form-item>

                        <el-form-item label="启用状态">
                            <el-radio v-model="radio" label="1">启用</el-radio>
                            <el-radio v-model="radio" label="2">禁用</el-radio>
                        </el-form-item>
                        <el-form-item label="备注：">
                            <el-input type="textarea" v-model="form.desc"></el-input>
                        </el-form-item>
                    </el-form>
                    <div class="demo-drawer__footer" style="text-align: center;margin-top: 10px">
                        <el-button type="primary" @click="$refs.drawer.closeDrawer()" :loading="loading">
                            {{ loading ? '提交中 ...' : '确 定' }}
                        </el-button>
                        <el-button @click="cancelForm">取 消</el-button>
                    </div>
                </div>
            </el-drawer>
            <el-table
                    :data="tableData"
                    style="width: 100%">
                <el-table-column
                        label="排序"
                        prop="serialNumber">
                </el-table-column>
                <el-table-column
                        label="学校名称"
                        prop="startYear">
                </el-table-column>
                <el-table-column
                        label="院系机构"
                        prop="semesterName">
                </el-table-column>
                <el-table-column
                        label="备注"
                        prop="studentID">
                </el-table-column>
                <el-table-column
                        label="状态"
                        prop="name">
                </el-table-column>
                <el-table-column
                        label="添加时间"
                        prop="sex">
                </el-table-column>
                <el-table-column
                        label="操作"
                        align="center">
                    <div>
                        <el-link type="primary">编辑</el-link>
                        <el-link type="danger">删除</el-link>
                    </div>

                </el-table-column>
            </el-table>
            &lt;!&ndash;分页&ndash;&gt;
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage4"
                        :page-sizes="[10, 20, 30, 40]"
                        :page-size="10"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="0">
                </el-pagination>
            </div>
        </el-tab-pane>-->

    </el-tabs>
</div>


<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="../../plugins/vue/vue.js"></script>
<!-- 引入组件库 -->
<script src="../../plugins/element-ui/index.js"></script>
<!-- 引入axios -->
<script src="../../plugins/axios/axios.min.js"></script>
<script src="../../js/request.js"></script>
<script src="../../api/baseList.js"></script>


<script>
    new Vue({
        el: '#app',
        data() {
            return {
                //学校下拉框
                schoolDownList:[
                    {
                        label:'',
                        value:''
                    }
                ],
                /*
                * 学校院系设置
                * */
                StDeptDtoDataList:[],

                pStDeptDtoDetails: {
                    currentPage: 1, // 当前页面
                    pageCount: 10, // 每页展示条
                    totalCount: 0 // 总页数
                },
               // 学校院系设置 添加院系提交的json 数据
                pStDeptDtoAdd: {
                    did:'',
                    //学校id
                    schoolId: '' ,
                    //院系名称
                    deptName:'',
                    //排序
                    sort:'',
                    // 状态
                    state: 1,
                    //备注
                    remarks:''
                },
                //学校院系设置 控制 侧边栏
                pStDeptDtoDialog: false,







                /*
                * 学校设置 遍历
                * */
                StSchoolDataList:[
                    {
                        sort:'',
                        qxName: '',
                        schoolName: '',
                        studentNum: '',
                        remarks: '',
                        state: 1,
                        createTime: ''
                    }
                ],

                /*
                * 学校设置 条件json数据
                * */
                StSchoolCondition:{
                    scid:null,
                    state:'',
                    sort:'',
                    schoolName: '',
                    remarks: '',
                    areaId: ''
                },

                /*
                * 学校设置 下拉框 条件
                * */
                StSchoolOptions:[
                   {value: '0', label: '未认证'},
                   {value: '1', label: '已认证'}
                ],
                StSchoolDetails: {
                    currentPage: 1, // 当前页面
                    pageCount: 10, // 每页展示条
                    totalCount: 0 // 总页数
                },
                StSchoolDialog: false,
                //地址下拉框
                areaList:[
                    {
                        label:'',
                        value:''
                    }
                ],






                drawer: false,
                drawer2: false,
                drawer3: false,
                drawer4: false,
                drawer5: false,
                drawer6: false,
                direction: 'rtl',
                radio: '1',
                table: false,
                dialog: false,
                loading: false,
                dialogTableVisible: false,
                currentPage4: 1,
                options: [{value: '选项1', label: '黄金糕'}, {value: '选项2', label: '双皮奶'}, {
                    value: '选项3',
                    label: '蚵仔煎'
                }, {value: '选项4', label: '龙须面'}, {value: '选项5', label: '北京烤鸭'}], value: '',
                form: {
                    name: '',
                    region: '',
                    date1: '',
                    date2: '',
                    delivery: false,
                    type: [],
                    resource: '',
                    desc: ''
                },
                classFrom:{
                    value:''
                },
                semesterFrom:{
                    value:''
                },
                courseFrom:{
                    value:''
                },
               schoolFrom:{
                    value:''
                },
                tableData: [{
                    serialNumber: '', //序号
                    facultyName: '', //院系名称
                    startYear: '', //入学年份
                    semesterName: '', //学期名称
                    studentID: '', //学号
                    name: '', //姓名
                    sex: '', //性别
                    efficient: '',//是否有效
                    status: '', //有效次数
                    isMileage: '',//有效里程
                    mileage: '',//跑步里程
                    punchNumber: '',//打卡编号
                    averagePace: '',//平均配速
                    startTime: '',//开始时间
                    endTime: '',//结束时间
                    isTotalStart: '',//总有效次数
                    isTotalMileage: '',//总有效里程
                    totalMember: '',//总参与人数
                    perStatus: '',//有效人均次数
                    isPerMileage: '',//有效人均里程
                }],
                dialogFormVisible: false
            }
        },
        created() {
            this.StDeptDtoList()
        },
        methods: {
            /*
            * d学校院系设置 点新增院系
            * */
            StDeptDtoAdd(){
                this.DeptNameAndDidList()
                this.pStDeptDtoDialog = true
            },
            /*
            * 学校院系设置 编辑
            * */
            updatePStDeptDto(id){
                this.DeptNameAndDidList()
                SelectByIdPStDeptDto(id).then((response) => {

                    this.pStDeptDtoAdd = response.data.data.data;
                    var num  =  this.pStDeptDtoAdd.schoolId + '';
                    this.pStDeptDtoAdd.schoolId = num
                    console.log(this.pStDeptDtoAdd)
                })
                this.pStDeptDtoDialog = true
            },
            /*
            * 学校院系设置  删除方法
            * */
            deletePStDeptDto(id){
                stDeptDtoDelete(id).then((response) => {
                    this.$message({
                        message: '删除成功',
                        type: 'success'
                    });
                    this.StDeptDtoList()
                })
            },
            /*
            * 学校院系设置 添加 院系 确定按钮
            * */
            StDeptDtoCancel(){
                console.log(this.pStDeptDtoAdd)
                if(this.pStDeptDtoAdd.did != '' &&  this.pStDeptDtoAdd.did != null){
                    stDeptDtoUpdate(this.pStDeptDtoAdd).then((response) => {
                        this.$message({
                            message: '修改成功',
                            type: 'success'
                        });
                        this.StDeptDtoCancelAdd()
                        this.StDeptDtoList()
                    })
                }else {
                    stDeptDtoAdd(this.pStDeptDtoAdd).then((response) => {
                        this.$message({
                            message: '添加成功',
                            type: 'success'
                        });
                        this.StDeptDtoCancelAdd()
                        this.StDeptDtoList()
                    })
                }
            },

            /*
            * 学校院系设置 添加 院系 取消按钮
            * */
            StDeptDtoCancelAdd(){
                this.pStDeptDtoAdd = {
                    did:null,
                    //学校名称
                    schoolName: '' ,
                        //院系名称
                        deptName:'',
                        //排序
                        sort:'',
                        // 状态
                        state: 1,
                        //备注
                        remarks:''
                }

                this.pStDeptDtoDialog = false
            },

            //学校院系设置 分页
            handleSizeChangepStDeptDto(val) {
                this.pStDeptDtoDetails.pageCount = val
            },
            /*
            * 学校院系设置
            * */
            handleCurrentChangepStDeptDto(val) {
                this.pStDeptDtoDetails.currentPage = val
                this.StDeptDtoList()
            },
            StDeptDtoList(){
                runningDetailsPage(this.pStDeptDtoDetails.currentPage,this.pStDeptDtoDetails.pageCount).then( (response) => {
                    this.StDeptDtoDataList = response.data.data.page.records
                    this.pStDeptDtoDetails.currentPage = response.data.data.page.current
                    this.pStDeptDtoDetails.pageCount = response.data.data.page.size
                    this.pStDeptDtoDetails.totalCount = response.data.data.page.total
                })
            },
            //获取学校列表
            DeptNameAndDidList(){
                getDeptNameAndDidList().then( (response) => {
                    this.schoolDownList=response.data.data.depts
                })
            },








            //学校设置 分页
            handleSizeChangeStSchool(val) {
                this.StSchoolDetails.pageCount = val
            },
            /*
            * 学校设置
            * */
            handleCurrentChangeStSchool(val) {
                this.StSchoolDetails.currentPage = val
                this.StSchoolList()
            },
            /*
            * 获取 StSchoolDataList
            * StSchoolCondition // 条件查询
            * StSchoolDetails // 分页条件
            * */
            StSchoolList(){
                StSchoolPage( this.StSchoolDetails,this.StSchoolCondition ).then( (response) => {
                    this.StSchoolDataList = response.data.data.depts.list
                    this.StSchoolDetails.currentPage =  response.data.data.depts.currentPage
                    this.StSchoolDetails.totalCount = response.data.data.depts.totalCount
                })
            },
            StSchoolButtonAdd(){
                this.StDeptDtoCancelAdd()
                this.StSchoolDialog = true
            },

            StDeptDtoCancelAdd(){
                this.StSchoolCondition = {
                    scid:null,
                    state:'',
                    sort:'',
                    schoolName: '',
                    remarks: '',
                    areaId: ''
                }
                this.StSchoolDialog = false
            },
            StSchoolAdd(){
                if(this.StSchoolCondition.scid != '' &&  this.StSchoolCondition.scid != null){
                }else {
                    console.log(this.StSchoolCondition)
                    StSchoolAddApi(this.StSchoolCondition).then((response) => {
                        this.$message({
                            message: '添加成功',
                            type: 'success'
                        });
                        this.StDeptDtoCancelAdd()
                        this.StSchoolList()
                    })
                }
            },
            //点重置按钮
            StSchoolReset(){
                this.StDeptDtoCancelAdd()
                this.StSchoolList()
            },
            deleteStSchool(id){
                deleteStSchoolApi(id).then((response) => {
                    this.$message({
                        message: '删除成功',
                        type: 'success'
                    });
                    this.StSchoolList()
                })
            },
            updateStSchool(id){
                //根据id查询
                SelectByIdSchool(id).then((response) => {
                    this.StSchoolCondition = response
                })
            },

















            //分页
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            },














            onSubmit() {
                alert("submit")
            },

        }


    })
</script>
</body>
</html>